<?php

require_once(__DIR__."/../autoload.php");


use Curl\SimpleCurl as SimpleCurl;

$curl = new SimpleCurl("https://baidu.com");

// 通过设置头信息，让目标网站觉得这个请求来自一个真实的浏览器。
$header = ['User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'];
$header[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9';
$header[] = 'Cache-Control: no-cache';

$curl->setHeaders($header);

// 测试GET
//$result = $curl->get("https://baidu.com",['q' =>'php', 'tab' => 'google']);
// 测试POST

$postData = [
    'appToken' => 'AT_Gx10uCnXN0ts5BRPmXAS6o3HMJKolO3R',
    'content' => '你持有的创成长目前在快速下跌, 已经达到3%！',
//    'summary' => '创成长波动异常（descent)',
    'contentType' => 1,
    'topicIds' => [
        133532433
    ],
    'url' => 'https://xueqiu.com/S/SZ159967'

];
$postData = json_encode($postData);
$result2 = $curl->post('http://wxpusher.zjiecode.com/api/send/message', $postData, true);
var_dump($result2);




